/*
 *  dotsAndLineScene.h
 *  opencvExample
 *
 *  Created by ycam on 11/03/04.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#pragma once
#include "ofMain.h"
#include "basePattern.h"


class dotsAndLineScene : public basePattern{
public:
	void setup(){
		allocate();
		//		numCheck = 8;	
		numCheckX = 8;
		numCheckY = 8;		
		for (int i = 0; i < h; i++){
			for (int j = 0; j < w; j++){
				char tmpval;
				if (i%3==0) {
					tmpval = j%25==0 ? 255 : 0;
				}else if (i%3==1) {
					tmpval = j%25>12 ? 255 : 0;										
				}
				else
				{
					int xGap = 50;
					float qVal = fabs(ofMap(j % xGap, 0, xGap-1, -1, 1, true) ) ;
					tmpval = qVal * qVal * maxGray;					
				}
				
				currentColorPixels[(i*w+j)*3 + 0] = tmpval;
				currentColorPixels[(i*w+j)*3 + 1] = tmpval;
				currentColorPixels[(i*w+j)*3 + 2] = tmpval;		
			}
		}
	}
	void update(){
		for (int i = 0; i < h; i++){
			for (int j = 0; j < w; j++){
			}
		}
		currentColorImage.setFromPixels(currentColorPixels, w, h);	
		count++;
	}
	void setupWhenPatternChanged(){
		count = 0;
	}
	int count;
	int numCheckX,numCheckY;
};